﻿using Castle.ActiveRecord;
using Financial.Infra.DDD;
using Financial.Core.Modulos.ModuloUsuario;
using Financial.Core.Modulos.ModuloDevedor;
using System.Collections.Generic;
using Financial.Core.Modulos.ModuloDebito;
using Financial.Core.Modulos.ModuloPermissao;

namespace Financial.Core.Modulos.ModuloUsuario
{
    [ActiveRecord]
    public class Usuario : IIdentifiable
    {
        [PrimaryKey]
        public int Id { get; set; }

        [Property]
        public string USU_STR_NOME { get; set; }


        [Property]
        public string USU_STR_LOGIN { get; set; }


        [Property]
        public string USU_STR_EMAIL { get; set; }


        [Property]
        public string USU_STR_SENHA { get; set; }

        [BelongsTo("USU_ID_PERMISSAO")]
        public Permissao Permissao { get; set; }

        [HasMany(MapType = typeof(Devedor), Lazy = true, Inverse = true)]
        public IList<Devedor> Devedor { get; set; }


        [HasMany(MapType = typeof(Debito), Lazy = true, Inverse = true)]
        public IList<Debito> Debito { get; set; }
    }
}
